package shujia.day08;

/*
    String作为参数传递


 */
public class StringBufferDemo3 {
    public static void main(String[] args) {
        String s1 = "hello";
        String s2 = "world";
        System.out.println("s1: " + s1 + ", s2: " + s2); // s1: hello,s2: world
        change(s1, s2);
        System.out.println("s1: " + s1 + ", s2: " + s2);// s1: hello,s2: world



    }

    public static void change(String s1, String s2) {
        System.out.println("s1: " + s1 + ", s2: " + s2);// s1: hello,s2: world
        s1 = s2;
        s2 = s1 + s2;
        System.out.println("s1: " + s1 + ", s2: " + s2);// s1: world,s2: worldworld
    }
}
